import request from '@/config/axios'

/** 客服信息信息 */
export interface WeComCustomerService {
          id: number; // 主键ID
          staffName?: string; // 客服姓名
          staffNickname: string; // 客服号昵称
          deptId: number; // 所属部门ID
          position: string; // 职位
          mobile: string; // 手机号
          email: string; // 邮箱
          status: number; // 状态
          maxConcurrent: number; // 最大并发接待数
          skills: string; // 技能标签(逗号分隔)
          avatarUrl: string; // 头像URL
          qrcodeUrl: string; // 客服二维码URL
  }

// 客服信息 API
export const WeComCustomerServiceApi = {
  // 查询客服信息分页
  getWeComCustomerServicePage: async (params: any) => {
    return await request.get({ url: `/mcm/we-com-customer-service/page`, params })
  },

  // 查询客服信息详情
  getWeComCustomerService: async (id: number) => {
    return await request.get({ url: `/mcm/we-com-customer-service/get?id=` + id })
  },

  // 新增客服信息
  createWeComCustomerService: async (data: WeComCustomerService) => {
    return await request.post({ url: `/mcm/we-com-customer-service/create`, data })
  },

  // 修改客服信息
  updateWeComCustomerService: async (data: WeComCustomerService) => {
    return await request.put({ url: `/mcm/we-com-customer-service/update`, data })
  },

  // 删除客服信息
  deleteWeComCustomerService: async (id: number) => {
    return await request.delete({ url: `/mcm/we-com-customer-service/delete?id=` + id })
  },

  /** 批量删除客服信息 */
  deleteWeComCustomerServiceList: async (ids: number[]) => {
    return await request.delete({
      url: `/mcm/we-com-customer-service/delete-list?ids=${ids.join(',')}`
    })
  },

  // 导出客服信息 Excel
  exportWeComCustomerService: async (params: any) => {
    return await request.download({ url: `/mcm/we-com-customer-service/export-excel`, params })
  }
}
